package com.fvff.sanctuary.service.impl;

import com.fvff.sanctuary.dao.PersonDao;
import com.fvff.sanctuary.model.Person;
import com.fvff.sanctuary.service.PersonService;
import org.springframework.transaction.annotation.Transactional;

@Transactional
public final class PersonServiceImpl implements PersonService {
    private PersonDao personDao;

    public void setPersonDao(final PersonDao personDao) {
        this.personDao = personDao;
    }

    public Person getPerson(final Long id) {
        return personDao.get(id);
    }

    public Person updatePerson(final Person person) {
        // person.setLastUpdatedData(ServiceUtil.createLastUpdatedData(accountDao));
        return personDao.save(person);
    }

    public void addActivity(final Person person, final String activity) {
        personDao.addActivity(person.getId(), activity);
    }

    public void removeActivity(final Person person, final String activity) {
        personDao.removeActivity(person.getId(), activity);
    }

}
